﻿


using System;
using System.Text;
using System.Collections;
using System.Xml;
using System.Data;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Resources;
using System.Reflection;
using System.Globalization;
using System.Threading;

using Telerik.WebControls;
using UFSoft.UBF.UI.WebControls;
using UFSoft.UBF.UI.WebControls.InterActionComponenet;
using UFSoft.UBF.Util.Log;
using UFSoft.UBF.Util.Context;

//using MagicAjax.UI.Controls;
using UFSoft.UBF.Report.UI.ReportView.Web;
using UFSoft.UBF.UI.WebControlAdapter;
using UFSoft.UBF.UI.FormProcess;
using UFSoft.UBF.UI.IView;
using UFSoft.UBF.UI.Engine;
using UFSoft.UBF.UI.Engine.Builder;
using UFSoft.UBF.UI.Engine.Authorization;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.ActionProcess;
using UFSoft.UBF.UI.ControlModel;
using UFSoft.UBF.UI.Controls;
using UFSoft.UBF.UI.WebControls.Association;
using UFSoft.UBF.UI.WebControls.ClientCallBack;
using System.Web.UI;
using UFSoft.UBF.UI.UIFormPersonalization;
using System.Collections.Specialized;


/***********************************************************************************************
 * Form ID:0139a473-dbb7-4811-a0f2-5fd5e915a3f0 
 * Form Name:BuildDate
 * UIFactory Auto Generator
 ***********************************************************************************************/
namespace UFSoft.UBF.EmptyUIModel
{
	[FormRegister("UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDUI","UFSoft.UBF.EmptyUIModel.BuildDateWebPart", "UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDUI.WebPart", "0139a473-dbb7-4811-a0f2-5fd5e915a3f0","WebPart", "True", 400, 225)] 
	///insert into aspnet_Parts (SysVersion, Path, ClassName, [Assembly], FormId) values (0, 'UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDUI', 'UFSoft.UBF.EmptyUIModel.BuildDateWebPart', 'UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDUI.WebPart', '0139a473-dbb7-4811-a0f2-5fd5e915a3f0')
	///<siteMapNode url="~/erp/simple.aspx?lnk=0139a473-dbb7-4811-a0f2-5fd5e915a3f0" title="BuildDate"/>
    public partial class BuildDateWebPart : UFSoft.UBF.UI.FormProcess.BaseWebForm
    {
		#region Page Controller/Code Behind
        private static readonly ILogger logger = LoggerManager.GetLogger(typeof(BuildDateWebPart));
        private string assemblyName = System.Reflection.Assembly.GetExecutingAssembly().FullName;
        //private string displayNamePostfix = "displayName";

		#region 强类型化基类属性.
		public new EmptyUIModelAction Action
		{
			get { return (EmptyUIModelAction)base.Action; }
			set { base.Action = value; }
		}
		EmptyUIModelModel _uimodel=null;
		public new EmptyUIModelModel Model
		{
			get 
			{
			     if(_uimodel == null){
			          _uimodel = new EmptyUIModelModel();
			     }
			     return _uimodel; 
			}
			set { _uimodel = value; }
		}
        protected override IUIModel UIModel{
            get{
                return this.Model;
            }
            set{
                this.Model = value as EmptyUIModelModel;
            }
        }
		#endregion 
		public FormAdjust adjust;
        #region variable declaration
        IUFCard Card0;
        IUFLabel Label6;
        IUFFldDatePicker DatePicker5;
        IUFCard Card1;
        IUFButton Btn_OK;
        IUFButton Btn_Close;
		UpdatePanel updatePanel;
		HiddenField wpFindID;
		IUFContainer topLevelPanel;     
        IUFSeparator SeparatorInFavorites;
        IUFButton BtnDefaultValues;
        #endregion
        
        #region constructor
        public BuildDateWebPart()
        {
            FormID = "0139a473-dbb7-4811-a0f2-5fd5e915a3f0";
            IsAutoSize = bool.Parse("False");
            NewIsAutoSize = bool.Parse("False");
        }
        #endregion


	
            
	//获取档案版型结果: 

        #region eventBind and databind
        private void EventBind()
        {
			//事件绑定模板
				//Button控件事件
			this.Btn_OK.Click += new EventHandler(Btn_OK_Click);		
						
				//Button控件事件
			this.Btn_Close.Click += new EventHandler(Btn_Close_Click);		
						


            AfterEventBind();
        }
        #endregion            
        
		#region override method
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad2(e);
		}
		protected override void OnLoadDataDo(EventArgs e)
		{
		    adjust.ProcessAdjustBeforeOnLoad(this);
			if (UIEngineHelper.IsDataBind(PageStatus, this))
			{
				if(this.Model==null){				        
					this.Model = new EmptyUIModelModel();
				}
				OnLoadConsumer(new InParameterModel[]{},new InParameterModel[]{});
				OnLoadData(this);
				this.IsDataBinding = true ; //加载完数据要绑定一次.目前加这.
			}
			else
			{
				//去除.已经移入到OnInit()中.
				//this.Model = (EmptyUIModelModel)this.CurrentState[this.TaskId.ToString()];
			}
			adjust.ProcessAdjustAfterOnLoadData(this);
		            AfterOnLoad();
            
            adjust.ProcessAdjustAfterOnLoad(this);
		}
		protected override void OnPreRender(EventArgs e)
		{
			base.OnPreRender2(e);
		}
        protected override void OnPreRenderDo(EventArgs e)
        {
            adjust.ProcessAdjustBeforeOnPreRender(this);
			base.OnPreRender(e);
			this.CurrentState[this.TaskId.ToString()] = this.Model;
			RegisterClearWebPartPadding();
            UFIDA.U9.UI.PDHelper.FormAuthorityHelper.SetWebPartAuthorization(this);
            
			if (IsDataBinding) //2006-9-7 可由开发人员控制
			{
				BeforeUIModelBinding();
								if(!Page.IsPostBack)
				{
					EnumTypeBinding.BindEnumControls(this);
				}
				UFIDA.U9.UI.Commands.CommandHelper.BindFlexData(this);
				adjust.ProcessAdjustBeforeDataBinding(this);
				if (this.IsOnlyDataBinding)
				{
					this.DataBinding();
				}
				adjust.ProcessAdjustAfterDataBinding(this);

				AfterUIModelBinding();
			}
			adjust.ProcessAdjustAfterOnPreRender(this);
        }
		protected override void OnInit(EventArgs e)
		{
			base.OnInit2(e);
		}
		protected override void OnInitDo(EventArgs e)
		{			 
			this.Page.InitComplete += new EventHandler(Page_InitComplete);
			WebPartBuilder.InitWebPart(this);
            this.Action = new EmptyUIModelAction(this);
            adjust = new FormAdjust();
		    CreateFormChildControls();
		}
        void Page_InitComplete(object sender, EventArgs e)
        {

            adjust.ProcessInit(this);
        }
        #endregion

      
        
        #endregion

	
		/// <summary>
        /// WebPart View
        /// </summary>
        #region view Create Contorls
        private void CreateFormChildControls()
        {
            IUFContainer _panel = UIControlBuilder.BuildTopLevelContainer(this,"BuildDate",true,400,225);
            CommonBuilder.ContainerGridLayoutPropBuilder(_panel, 1, 1, 0, 0, 10, 10, 10, 10);
			InitViewBindingContainer(this, _panel,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_panel, 0,new GridColumnDef[]{new GridColumnDef(380,bool.Parse("True"),"Value"),},new GridRowDef[]{new GridRowDef(202,bool.Parse("False")),});
            //???还有用么?
            topLevelPanel = _panel;    
            
            UIControlBuilder.BuildCommonControls(this,ref updatePanel,ref wpFindID);
            





	
			_BuilderControl_Card0(_panel);

		
			UIControlBuilder.BuilderUFControl(this.Card0, "0");		



	
     
			
			
            EventBind();
            AfterCreateChildControls();
            
        }        







	                   
        private IUFCard _BuilderControl_Card0(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card0",false,"none", true, true, "0","","a8649703-d6fa-46e7-83ab-2b22d236f8ce");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 380, 202, 0, 0, 1, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 4, 5, 0, 5, 10, 10, 10, 10);
			InitViewBindingContainer(this, _UFCard,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 5,new GridColumnDef[]{new GridColumnDef(80,bool.Parse("True"),"Title"),new GridColumnDef(10,bool.Parse("True"),"Spacing"),new GridColumnDef(120,bool.Parse("True"),"Value"),new GridColumnDef(120,bool.Parse("True"),"Value"),},new GridRowDef[]{new GridRowDef(20,bool.Parse("False")),new GridRowDef(20,bool.Parse("False")),new GridRowDef(20,bool.Parse("False")),new GridRowDef(20,bool.Parse("False")),new GridRowDef(80,bool.Parse("False")),});
            this.Card0 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





				this.Label6 = UIControlBuilder.BuilderUFLabel(_UFCard, "Label6", "", "True", "True", "Right", 80, 20, 0, 1, 1, 1, "100","68f4affd-182c-4084-a1db-4ae2e544521a","68f4affd-182c-4084-a1db-4ae2e544521a");


								

		
			UIControlBuilder.BuilderUFControl(this.Label6, "0");		


				this.DatePicker5 = UIControlBuilder.BuilderDatePicker(_UFCard, "DatePicker5", true, true, true, "Date","Left", 0, 60, 0, 120, 20, 2, 1, 1, 1, "100",true,false,"","","097169da-af1d-4115-b9d1-f15cbae0942a");
			UIControlBuilder.BuilderUIFieldBindingControl(this, this.DatePicker5, "False", "", null, null, "");


		
			UIControlBuilder.BuilderUFControl(this.DatePicker5, "1");		
		 

	
			_BuilderControl_Card1(_UFCard);

		
			UIControlBuilder.BuilderUFControl(this.Card1, "0");		



			

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }

	                   
        private IUFCard _BuilderControl_Card1(IUFContainer container)
        {
            IUFCard _UFCard = UIControlBuilder.BuildCard(container,"Card1",false,"none", true, true, "0","","d1e706c2-ab2c-47f3-a667-6ac60f17cfc7");
			CommonBuilder.GridLayoutPropBuilder(container, _UFCard, 330, 80, 0, 4, 4, 1, "100");
            CommonBuilder.ContainerGridLayoutPropBuilder(_UFCard, 4, 1, 0, 5, 10, 40, 10, 10);
			InitViewBindingContainer(this, _UFCard,  null, "", "", null, 1, "");
			UIControlBuilder.BuildContainerGridLayout(_UFCard, 5,new GridColumnDef[]{new GridColumnDef(20,bool.Parse("True"),"Title"),new GridColumnDef(60,bool.Parse("True"),"Value"),new GridColumnDef(60,bool.Parse("True"),"Value"),new GridColumnDef(60,bool.Parse("True"),"Value"),},new GridRowDef[]{new GridRowDef(20,bool.Parse("False")),});
            this.Card1 = _UFCard;

            ///foreach UFCard下的所有控件，增加到此容器





				this.Btn_OK = UIControlBuilder.BuilderUFButton(_UFCard, true, "Btn_OK", true, true, 60, 20, 1, 0, 1, 1, "100","", this.Model.ElementID,"",false,"4a657bda-01d4-46ab-aad2-eed3149cdbdf","","4a657bda-01d4-46ab-aad2-eed3149cdbdf");
	

		
			UIControlBuilder.BuilderUFControl(this.Btn_OK, "2");		


				this.Btn_Close = UIControlBuilder.BuilderUFButton(_UFCard, true, "Btn_Close", true, true, 60, 20, 3, 0, 1, 1, "100","", this.Model.ElementID,"",false,"7b78b7f1-1ad2-4c25-9434-6a3d61c624f0","","7b78b7f1-1ad2-4c25-9434-6a3d61c624f0");
	

		
			UIControlBuilder.BuilderUFControl(this.Btn_Close, "3");		



		

            
            container.Controls.Add(_UFCard);
            return _UFCard;
        }





		#endregion
		

	}
}
